export interface IForm {
  formOptions: FormOptions
  findById(): void
}

export interface DropdownOption {
  name: string
  icon: string
  command: any
  permission?: string
}
export interface SortDropdownOption {
  name: string
  key: string
  sort: 'desc' | 'asc' | ''
  permission?: string
}

export enum Type {
  Create = '创建',
  Edit = '编辑',
  View = '查看',
  Delete = '删除'
}

export enum OperationType {
  Create = '创建',
  Edit = '编辑',
  View = '查看',
  Delete = '删除',
  BrowseReport = '浏览报告',
  Preview = '预览',
  Copy = '复制',
  MoveCan = '移入垃圾桶'
}

export enum FormType {
  Input,
  Select,
  MultiSelect,
  DateRange,
  DateTimeRange
}

export interface FormOptions {
  title: string
  type?: Type
  showStatusIcon?: boolean
  readonly dialogWidth: string
  readonly labelWidth: string
  formItems: FormItem[]
}

export interface FormItem {
  readonly label: string
  readonly key: string
  readonly formType: FormType
  // Date类型时用到
  readonly keys?: string[]
  value: any
  options?: any[]
  rules?: any[]
  readonly placeholder?: string
  readonly permission?: string
  readonly onlyView?: boolean
  readonly disabled?: boolean
  readonly disabledEdit?: boolean
  readonly slot?: boolean
  readonly customStyle?: string
}
